/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rothserve;

/**
 *
 * @author Alex
 */
import java.io.*;
import java.net.*;
import java.util.*;
public class rothserveServer {
ServerSocket serverSock;
ArrayList<PrintWriter> clients = new ArrayList<PrintWriter>();
String message;
String path = "index.html";


public void start(){
try {
String pathProp = System.getProperty("user.dir") + "/ports.config";
FileInputStream fis = new FileInputStream(pathProp);
Properties props = new Properties();
props.load(fis);
fis.close();
int portNum = Integer.parseInt(props.getProperty("port"));
serverSock = new ServerSocket(portNum);
System.out.println("Server started on port:" + portNum);

while(true){
Socket clientSocket = serverSock.accept();
System.out.println("Client connected");
Thread t = new Thread(new rothserveClientResponder(clientSocket));
t.start();
System.out.println("Thread started");
}

}catch(Exception ex) {
ex.printStackTrace();
}

}

}
